Skip to content

Hole05#3

Open
Julesc002 wants to merge 7 commits into
mainfrom
hole05
Open

Hole05#3
Julesc002 wants to merge 7 commits into
mainfrom
hole05

Conversation

@Julesc002

Copy link
Copy Markdown
Owner

No description provided.

@D4rkP4ng0l1n

D4rkP4ng0l1n commented Nov 30, 2023

Copy link
Copy Markdown
Collaborator

Modification de l'interface Tile. Désormais Tile sera une classe qui servira à tester les différentes conditions des if de la classe Game. Grâce à la classe Tile, les conditions if comprenant un this._board.TileAt verront leur écriture simplifié dans la classe Game.

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
}

private validatePositionIsEmpty(x: number, y: number) {
if (this._board.TileAt(x, y).Symbol != emptyPlay) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Création d'une méthode isNotEmpty dans la classe Tile

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
return (
this._board.TileAt(row, firstColumn)!.Symbol != emptyPlay &&
this._board.TileAt(row, secondColumn)!.Symbol != emptyPlay &&
this._board.TileAt(row, thirdColumn)!.Symbol != emptyPlay

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Utilisation de la méthode isNotEmpty pour les 3 conditions du return

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
this._board.TileAt(row, firstColumn)!.Symbol ==
this._board.TileAt(row, secondColumn)!.Symbol &&
this._board.TileAt(row, thirdColumn)!.Symbol == this._board.TileAt(row, secondColumn)!.Symbol
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Création d'une méthode hasSameSymbolAs dans la classe Tile

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
//@ts-ignore
const tile: Tile = { X: x, Y: y, Symbol: symbol };

this._plays.find((t: Tile) => t.X == x && t.Y == y)!.Symbol = symbol;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Création d'une méthode hasSameCoordinatesAs et UpdateSymbol dans la classe Tile

+ Création d'une méthode isNotEmpty dans la classe Tile
+ Utilisation de la méthode isNotEmpty pour les 3 conditions du return
+ Création d'une méthode hasSameSymbolAs dans la classe Tile
+ Création d'une méthode hasSameCoordinatesAs et UpdateSymbol dans la classe Tile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants